<%-- 
    Document   : addArticle
    Created on : Oct 26, 2012, 9:56:30 AM
    Author     : HAITHE
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@taglib  uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>

<jsp:useBean id="articleCategoryModel" scope="session" class="Model.ArticleCategoryModel"/>
<c:set var="articleCates" value="${articleCategoryModel.allArticleCategory}"/>

<h3>Add New Article</h3>
<html:form action="/articleAction?action=add">
    <table width="95%">
        <tr><td><b>Category</b></td><td>
             <html:select property="category_id">
            <c:forEach  var="articleCate" items="${articleCates}">                                         
                <html:option value="${articleCate.id}">
                    ${articleCate.name}
                </html:option>
            </c:forEach>
        </html:select></td></tr> 
<tr><td><b>Title</b></td><td><html:text property="title"/></td></tr>
<tr><td><b>Content</b></td><td><html:textarea property="content"/></td></tr>
<tr><td><b>Rate</b></td><td><html:text property="rate"/></td></tr>
<tr><td><b>Status</b></td><td>
        <html:radio  property="status" value="true"  />True
        <html:radio  property="status" value="false"/> False
    </td></tr> 
<tr><td></td><td>
        <html:submit styleClass="button" value="Add"/>
        <html:reset styleClass="button"/>
    </td></tr>
</table>
</html:form>